<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Diary</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
    <div class="container">
        <h1>My Diary</h1>
        
        <form action="{{ url_for('submit') }}" method="post">
            <div class="form-group">
                <label for="date">Date:</label>
                <input type="date" id="date" name="date" required>
            </div>
            <div class="form-group">
                <label for="weather">Weather:</label>
                <input type="text" id="weather" name="weather" required>
            </div>
            <div class="form-group">
                <label for="mood">Mood:</label>
                <input type="text" id="mood" name="mood" required>
            </div>
            <div class="form-group">
                <label for="event">Event:</label>
                <textarea id="event" name="event" rows="4" required></textarea>
            </div>
            <button type="submit">Submit</button>
        </form>

        <h2>History</h2>
        <ul>
            {% for entry in entries %}
                <li>
                    <strong>Date:</strong> {{ entry.date }}<br>
                    <strong>Weather:</strong> {{ entry.weather }}<br>
                    <strong>Mood:</strong> {{ entry.mood }}<br>
                    <strong>Event:</strong> {{ entry.event }}<br>
                </li>
            {% endfor %}
        </ul>
    </div>
</body>
</html>